home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_slideladder.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  146 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_slideladder.cog      Make the clock tower ladders slide in/out.  
  4. #
  5. # [JWC, RKD]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message    startup
  14. message activated
  15.  
  16. sound   slidestart=shs_platform_start.wav    local 
  17. sound   slide=shs_platform_move.wav            local  
  18. sound   slidestop=shs_platform_stop.wav        local 
  19.  
  20. thing    ladder0                nolink            # critical path  
  21. thing   ladder1                              # treasure 
  22. thing   button 
  23. thing    player                local
  24. thing    Cam1
  25. thing    c1_t1
  26. thing    c1_t2
  27.  
  28. int      locked=0             local
  29. int        slideloop            local
  30. int        ladderpos=0            local
  31. int        curcam                local
  32.  
  33. cog        NoWorkTalkcog
  34.  
  35. end
  36.  
  37. # ========================================================================================
  38.  
  39. code
  40.  
  41. startup:
  42.     
  43.     # throw some light on the ladders
  44.     SetThingLight(ladder0, '0.30 0.30 0.25', 0.01, 0.01);
  45.     SetThingLight(ladder1, '0.30 0.30 0.25', 0.01, 0.01);
  46.     return;
  47.  
  48. activated:
  49.     
  50.     if (GetSenderRef() != button) return;
  51.     Print("activated");
  52.     
  53.     #Prep
  54.     player= GetLocalPlayerThing();
  55.     
  56.     SetActorFlags(player, 0x200000);
  57.     StartCutscene(0);
  58.     StopThing(player);
  59.     DeselectWeapon(player);
  60.     DeselectWeaponWait(player);
  61.        
  62.     # Cut to Indy 
  63.     curCam = GetCurrentCamera();   
  64.     SetCameraLookInterp(2, 0); # no pan & tilt
  65.     SetCameraPosInterp(2, 0); # no dolly
  66.     SetCameraFocus(2, Cam1);
  67.     SetCameraSecondaryFocus(2, c1_t1);
  68.     Sleep(0.01);
  69.     SetCurrentCamera(2);
  70.     SetCameraFOV(70, 0, 0);
  71.   
  72.     
  73.     # Indy push button animation
  74.     PlayMode(player, 60, 0);
  75.     
  76.     # synch with button
  77.     Sleep(.3);
  78.                           
  79.     MoveToFrame(button, 1, 2);
  80.     WaitForStop(button);
  81.  
  82.     if (global3 == 0) 
  83.     {
  84.         #Call NoWorkTalkCog
  85.         Sleep(.3);
  86.         SendMessageEx(NoWorkTalkCog, user1, 0, 0, 0, 0);
  87.         global15 = 0; # per Randy
  88.         while (global15 == 0)
  89.             {
  90.                 Sleep(0.01); # wait for line to finish
  91.             }
  92.     }
  93.     
  94.     if ((locked == 0) && (global3 == 1))
  95.     {
  96.         locked=1;
  97.         
  98.         # Pan to ladder
  99.         SetCameraLookInterp(2, 1); # pan & tilt
  100.         SetCameraInterpSpeed(2, 3.0);
  101.         Sleep(0.01);
  102.         SetCameraSecondaryFocus(2, c1_t2);
  103.         SetCurrentCamera(2);
  104.         SetCameraFOV(60, 1, 3.0);
  105.         sleep(2);
  106.         PlaySoundLocal(slidestart, 1.0, 0.0, 0x0, 0);
  107.         
  108.         ladderpos=1-ladderpos;
  109.         if (ladderpos == 1) 
  110.         {
  111.             # Move ladders out      
  112.             MoveToFrame(ladder0, 1, 1);        # timed ladders moves out
  113.             MoveToFrame(ladder1, 1, 1);
  114.         }
  115.         else
  116.         {
  117.             MoveToFrame(ladder0, 0, 1);     # timed ladder retracts
  118.             MoveToFrame(ladder1, 0, 1);
  119.             ladderpos=0;
  120.         }
  121.         # play sound
  122.         slideloop=PlaySoundLocal(slide, 1.0, 0.0, 0x1, 0);
  123.         WaitForStop(ladder0);
  124.         StopSound(slideloop, 0.0);
  125.         PlaySoundLocal(slidestop, 1.0, 0.0, 0x0, 0);
  126.         
  127.         sleep(.5); #beat
  128.     }
  129.     MoveToFrame(button, 0, 2);
  130.     locked = 0;                         # allows button to be pushed again
  131.     
  132.     # Cleanup
  133.     SetCameraPosition(1, GetThingPos(Cam1)); # prep to swing back to follow-cam
  134.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  135.     SetCameraPosInterp(2, 0); # kill dolly mode
  136.     sleep(.01);
  137.     ResetCameraFOV(0, 0.0);
  138.     SetCurrentCamera(curCam);  
  139.     ClearActorFlags(player, 0x200000);
  140.     EndCutscene();    
  141.     return;
  142.     
  143.  
  144. end
  145.  
  146.